<?
require '../inc.php';
////////////////////
$act  = isset($_GET['act'])?$_GET['act']:'';
$cat  = $_GET['cat'];
$order= $_GET['order'];
$q  = $_GET['q'];
$urs  = $_GET["urs"];
$page = isset($_GET['page'])?(int)$_GET['page']:1;
$rows = 20;
//输出
$db_goods   = new db($scfg['db']['goods']);
$shop_info	= shop::getInfo($db_goods,$urs);
if(empty($shop_info))
{
    g::gowin(surl::get("search")."index.php?urs=".urlencode($urs));
}
tpl::assign('shop_class_name',shop::id2name($db_goods,$shop_info["shop_class"]));
tpl::assign('act',$act);
tpl::assign('cat',$cat);
tpl::assign('order',$order);
tpl::assign('q',$q);
tpl::assign('urs',$urs);
tpl::assign('shop_info',$shop_info);
if($act)
{
	if( $act== "info")
	{
		
		tpl::display("shop/shopInfo.s.tpl.php");
	}elseif( $act== "credit")
	{
		tpl::display("shop/shopCredit.s.tpl.php");
	}	
}else
{
	tpl::assign('shop_list',shop::shoplist($db_goods,$urs,$page,$rows,$cat,$q,$order));
	tpl::assign('shop_recommend',shop::shoprecommend($db_goods,$urs));
	tpl::assign('shop_class',shop::subClass($db_goods,$urs));
	tpl::assign('shop_friendLink',shop::friendLink($db_goods,$urs));
	tpl::display("shop/shop.s.tpl.php");
}
?>